โจ ์ ์ ์ธ์ฆ - ๊ต๋ณด๋ฌธ๊ณ API
- URI : /api/kyobo/auth
- Method : POST
- Parameter Type : Body - JSON
- Product Env Request URL : https://www.library.kr/cyber/api/kyobo/auth
๐ฎ Request
{
uid : ํ์์์ด๋ (string,ํ์)
token : ํ์๋น๋ฐ๋ฒํธ (string,ํ์)
}
- example code
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"uid": "userid",
"token": "userpassword"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://www.library.kr/cyber/api/kyobo/auth", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
๐ Response
์ฑ๊ณต์
- 200 OK
{
"uuno": 1319751, // ์ ์ ํค (ํ์ฌ ์ฌ์ฉ์ฒ๋ ์์)
"ebookSubsYn": "N", // ๊ตฌ๋
ํ ์ด์ฉ๊ฐ๋ฅ ์ฌ๋ถ (๋ก๊ทธ์ธ ์ฑ๊ณต์๋ง ๋ฐํ)
"ebookOwnerYn": "Y", // ์์ฅํ ์ด์ฉ๊ฐ๋ฅ ์ฌ๋ถ (๋ก๊ทธ์ธ ์ฑ๊ณต์๋ง ๋ฐํ)
"resultCode": "0000", // ๊ฒฐ๊ณผ์ฝ๋ ์๋ ์ฝ๋ ๋ฆฌ์คํธ ์ฐธ๊ณ
"resultMessage": "success" // ๊ฒฐ๊ณผ ๋ฉ์ธ์ง
}
| ๊ฒฐ๊ณผ์ฝ๋ | ๋น๊ณ |
|---|---|
| 0000 | ์ฑ๊ณต(์ผ์น) |
| 0001 | ์์ด๋ ํน์ ๋น๋ฐ๋ฒํธ ๋ถ์ผ์น (ํน์ ํ์์ ๋ณด ์์) |
| 0002 | ์ ๊ทผ์ฐจ๋จ๋ ๊ณ์ |
| 0003 | ์ ํจํ์ง ์์ ํ๋ผ๋ฏธํฐ (ํน์ ํ์ ํ๋ผ๋ฏธํฐ ๋๋ฝ) |
์คํจ์ - type null or undefined
- 400 BAD REQUEST
{
"httpStatus": "BAD_REQUEST",
"errorCode": null,
"errorResult": null,
"message": "type is required",
"errors": null
}
- 415
{
"httpStatus": "UNSUPPORTED_MEDIA_TYPE",
"errorCode": null,
"errorResult": null,
"message": "API์ ๋ณด๋ด๋ Parameter์ Content-Type์ด ์๋ชป๋์์ต๋๋ค.",
"errors": null
}
- 500 ์๋ฒ์ค๋ฅ
{
"httpStatus": "INTERNAL_SERVER_ERROR",
"errorCode": null,
"errorResult": null,
"message": "Server Error",
"errors": null
}